<template>
  <view :style="themeColor">
    <view class="page">
      <view
        class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex feedBack_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-stretch justify-between feedBack_fd0_0'>
          <view class='flex flex-wrap align-center feedBack_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  feedBack_fd0_0_c0_c0'>&#xe794;</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <text class='feedBack_fd0_0_c1_c0'>意见反馈</text>
          </view>
          <view class='flex align-center justify-end feedBack_fd0_0_c2'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---意见反馈表单flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-direction align-stretch feedBack_fd1_0'>
          <view class='flex flex-wrap align-center feedBack_fd1_0_c0'>
            <text class='feedBack_fd1_0_c0_c0'>反馈类型</text>
           <!-- <text class='feedBack_fd1_0_c0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/myB/feedBackDetail/feedBackDetail`">反馈记录</text> -->
          </view>
          <view class='flex flex-direction flex-wrap align-stretch feedBack_fd1_0_c1'>
            <view class='flex flex-wrap align-center'>
              <benben-select-diy ref="showSelectPopup1694772185571" class-name='flex flex-wrap flex'
                :items.sync="data_list" v-model="data_value" :label.sync="data_label" default-type="aid"
                default-label="title" :allow-cancel='false' type="radio" :disabled='false' @change='leitype'>
                <template v-for='(item,key0) in data_list'>
                  <view v-if="item.isSelected" class='flex flex feedBack_fd1_0_c1_c0_c0_c0' :key="key0"
                    @tap="$refs.showSelectPopup1694772185571.tapHandle(key0)">
                    <text class='flex-sub feedBack_fd1_0_c1_c0_c0_c0_c0'>{{item.title}}</text>
                  </view>
                  <view v-else class='flex flex feedBack_fd1_0_c1_c0_c0_c1' :key="key0"
                    @tap="$refs.showSelectPopup1694772185571.tapHandle(key0)">
                    <text class='flex-sub feedBack_fd1_0_c1_c0_c0_c1_c0'>{{item.title}}</text>
                  </view>
                </template></benben-select-diy>
            </view>
          </view>
          <text class='feedBack_fd1_0_c2'>问题描述</text>
          <view class='flex flex-direction flex-wrap align-stretch feedBack_fd1_0_c3'>
            <view class='flex flex-wrap feedBack_fd1_0_c3_c0'>
              <textarea class='flex feedBack_input_fd1_0_c3_c0' confirm-type="done"
                :placeholder="'问题描述的越详细，有助于我们更快的解决问题'" :maxlength="300" :show-num='true'
                placeholder-style="color:#999;font-size:28rpx" v-model="body" />
              <template>
                <view class='flex flex justify-end feedBack_numberfd1_0_c3_c0_c0'>
                  <text>{{body.length}}</text>
                  <text>/</text>
                  <text>300</text>
                </view>
              </template>
            </view>
          </view>
        </view>
        <button class='flex-sub feedBack_fd1_1' @tap.stop="postfeedbackFunc()">提交反馈</button>
      </view>

      <!---意见反馈表单flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "body": "",
        "img": [],
        "img_id": "",
        "data_list": [{
					aid:1,
					title:'举报'
				},
				{
					aid:2,
					title:'软件反馈'
				},
				{
					aid:3,
					title:'建议'
				}],
        "data_value": '',
        "data_label": "",
        imgList: [], //图片数组
        imgIds: '', //图片id
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {

      leitype(e) {

        this.data_value = e.label
        console.log(this.data_value, 'eeee')
      },
      //提交反馈
      async postfeedbackFunc() {
        if (!validate(this.data_value, 'require')) {
          this.$message.info('请选择反馈类型');
          return false;
        }
        if (!validate(this.body, 'require')) {
          this.$message.info('请输入问题描述');
          return false;
        }
				this.$message.info('提交成功');
				setTimeout(() => {
				  uni.navigateBack()
				}, 800);
				return false
        let str = this.imgList.length > 0 ? this.imgList.join(',') : '';
        let dataresult = await this.$api.post(global.apiUrls.post6414724b96f3f, {
          type_id: this.data_value,
          body: this.body,
          thumb: str,
        });
        if (dataresult.data.code != 1) {
          this.$message.info(dataresult.data.msg);
          return;
        }
        this.$message.info('提交成功');
        setTimeout(() => {
          uni.redirectTo({
            url: '/pages/myB/feedBackDetail/feedBackDetail'
          })
        }, 800);
      },

    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(246, 247, 249, 1);
    background-size: 100% auto;
  }

  .feedBack_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .feedBack_fd0_0_c2 {
    padding: 0rpx 0rpx 0rpx 0rpx;
    width: 200rpx;
  }

  .feedBack_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
    line-height: 50rpx;
  }

  .feedBack_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 400;
    color: #333;
  }

  .feedBack_fd0_0_c0 {
    width: 200rpx;
  }

  .feedBack_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .feedBack_fd1_1 {
    background: #167deb;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor3);
    height: 88rpx;
    line-height: 88rpx;
    width: 638rpx;
    position: fixed;
    left: 53rpx;
    bottom: calc(40rpx + var(--window-bottom));
  }

  .feedBack_fd1_0_c4_c02 {
    font-size: 24rpx;
    color: var(--benbenFontColor2);
    font-weight: 400;
    width: 100%;
  }

  .feedBack_fd1_0_c4_c01 {
    width: 160rpx;
    height: 160rpx;
    margin: 0rpx 24rpx 24rpx 0rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .feedBack_fd1_0_c4_c001 {
    width: 160rpx;
    height: 160rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .feedBack_fd1_0_c4_c000 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .feedBack_fd1_0_c4_c00 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .feedBack_fd1_0_c4_c0 {
    padding: 24rpx 0rpx 0rpx 24rpx;
  }

  .feedBack_numberfd1_0_c3_c0_c0 {
    width: 100%;
    font-size: 24rpx;
    color: rgba(153, 153, 153, 1);
    line-height: 46rpx;
    font-weight: 400;
  }

  .feedBack_input_fd1_0_c3_c0 {
    width: 100%;
    height: 166rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: var(--benbenFontColor0);
  }

  .feedBack_fd1_0_c3_c0 {
    width: 686rpx;
    border-radius: 10rpx 10rpx 10rpx 10rpx;
    margin: 0rpx 0rpx 0rpx 32rpx;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .feedBack_fd1_0_c3 {
    margin: 0rpx 0rpx 32rpx 0rpx;
  }

  .feedBack_fd1_0_c2 {
    font-size: 32rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
    line-height: 109rpx;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .feedBack_fd1_0_c1_c0_c0_c1_c0 {
    font-size: 28rpx;
    font-weight: 400;
    color: rgba(102, 102, 102, 1);
    line-height: 62rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-align: center;
    max-width: 216rpx;
  }

  .feedBack_fd1_0_c1_c0_c0_c1 {
    background: #F8F8F8;
    border-radius: 48rpx 48rpx 48rpx 48rpx;
    width: 218rpx;
    height: 64rpx;
    margin: 0rpx 16rpx 16rpx 0rpx;
  }

  .feedBack_fd1_0_c1_c0_c0_c0_c0 {
    font-size: 28rpx;
    font-weight: 400;
    color: var(--benbenFontColor3);
    line-height: 62rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-align: center;
    max-width: 216rpx;
  }

  .feedBack_fd1_0_c1_c0_c0_c0 {
    background: #167deb;
    border-radius: 48rpx 48rpx 48rpx 48rpx;
    width: 218rpx;
    height: 64rpx;
    opacity: 1;
    margin: 0rpx 16rpx 16rpx 0rpx;
  }

  .feedBack_fd1_0_c1 {
    border-bottom: 10px solid rgba(246, 247, 248, 1);
    padding: 0rpx 16rpx 16rpx 32rpx;
  }

  .feedBack_fd1_0_c0_c1 {
    font-size: 28rpx;
    font-weight: 400;
    color: #999999;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .feedBack_fd1_0_c0_c0 {
    font-size: 32rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
  }

  .feedBack_fd1_0_c0 {
    padding: 32rpx 32rpx 24rpx 32rpx;
  }

  .feedBack_fd1_0 {
    background: var(--benbenbgColor1);
    background-size: 100% auto !important;
    padding: 0rpx 0rpx 48rpx 0rpx;
    margin: 0rpx 0rpx 180rpx 0rpx;
  }
</style>